<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对字符串和数字相加</title>
</head>

<body>
    <h1>JavaScript 运算符</h1>

    <p>对数字和字符串相加，会返回字符串。</p>

    <p id="demo"></p>
    <script>
        var x = 7 + 8;
        var y = "7" + 8;
        var z = "hello" + 7;
        document.getElementById("demo").innerHTML = x + "<br>" + y + "<br>" + z;
    </script>
</body>

</html>